/*
 * @Descripttion:
 * @version:
 * @Author: cain
 * @Date: 2023-01-11 10:47:41
 * @LastEditors: Andy
 * @LastEditTime: 2023-02-01 15:26:50
 * @FilePath: \cain-ui\script\install.ts
 */
import { App } from "vue";
import app from "../package/App/inedx";
import "../styles/globalColor.scss";
import "../styles/globalUtils.scss";
import "../styles/globalUtils.scss";
import "../styles/themeLight.scss";
import { useCainUiTheme } from "../package/theme/theme";
import { createCainUiOption } from "./../utils/Dto/createCainUiOption.Dto";
import "@mdi/font/css/materialdesignicons.css";
import Button from "../package/button/inedx";
import CApp from "../package/App/inedx";
import Icon from "../package/icon/index";
import Checkbox from '../package/checkbox/inedx';
import { RippleFuc } from "../directive/ripple";
import Radio from "../package/radio";
import radioGroup from "../package/radioGroup";
import Appbar from '../package/appbar/index'
const cain = [Button, CApp, Icon, Radio, radioGroup, Checkbox,Appbar];

export const install = (vue: App, arg: createCainUiOption) => {
  cain.forEach((dom) => {
    vue.component(dom.name, dom);
  });

  vue.directive("ripple", {
    mounted(el: any, type: any) {
      RippleFuc(el, type);
    },
  });
  if (arg.theme) useCainUiTheme({ ...arg.theme });
};
